//package com.ybwh.springboot2.util.excel;
//
//import com.alibaba.excel.converters.Converter;
//import com.alibaba.excel.enums.CellDataTypeEnum;
//import com.alibaba.excel.metadata.CellData;
//import com.alibaba.excel.metadata.GlobalConfiguration;
//import com.alibaba.excel.metadata.property.ExcelContentProperty;
//import com.gitee.fastmybatis.core.handler.BaseEnum;
//import com.ybwh.springboot2.common.enums.CodeTextEnum;
//import com.ybwh.springboot2.common.enums.CodeTextEnumUtils;
//import org.apache.commons.lang3.StringUtils;
//
///**
// * excel导入自定义枚举转换类
// * @author likailang
// * @date 2021-02-03
// */
//public class EnumConverter implements Converter<CodeTextEnum> {
//    @Override
//    public Class supportJavaTypeKey() {
//        return CodeTextEnum.class;
//    }
//
//    @Override
//    public CellDataTypeEnum supportExcelTypeKey() {
//        return CellDataTypeEnum.STRING;
//    }
//
//    @Override
//    public BaseEnum convertToJavaData(CellData cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
//        if (StringUtils.isEmpty(cellData.getStringValue())){
//            return null;
//        }
//        return (BaseEnum) CodeTextEnumUtils.getEnumByDisPlayName(contentProperty.getField().getType(),cellData.getStringValue());
//    }
//
//
//    @Override
//    public CellData convertToExcelData(BaseEnum value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
//        return new CellData(value.getDisplayName());
//    }
//
//
//
//}
